package com.banshuibao.bsb_android.util;

import android.app.Activity;
import android.content.Context;
import android.view.inputmethod.InputMethodManager;

/**
 * Created by wangpan on 2018/6/27.
 */

public class KeyBroadHintShow {

    public static void hintKeyboard(Activity context) {
        InputMethodManager imm = (InputMethodManager)context.getSystemService(Context.INPUT_METHOD_SERVICE);
        if(imm!=null&&imm.isActive()&&context.getCurrentFocus()!=null){
            if (context.getCurrentFocus().getWindowToken()!=null) {
                imm.hideSoftInputFromWindow(context.getCurrentFocus().getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
            }
        }
    }

}
